home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 554 < prev    next >
Text File  |  1996-08-06  |  1KB  |  32 lines

  1. Path: sundog.tiac.net!stanr
  2. From: stanr@tiac.net (Stan Ryckman)
  3. Newsgroups: comp.std.c
  4. Subject: Re: alignment requirements for all structures?
  5. Date: 13 Mar 1996 14:27:51 GMT
  6. Organization: Amber & Sneakers Fan Club
  7. Message-ID: <4i6m18$81a@sundog.tiac.net>
  8. References: <1996Mar7.151216.1793@ittpub> <1996Mar12.175916.7256@sq.com>
  9. NNTP-Posting-Host: sunspot.tiac.net
  10.  
  11. In article <1996Mar12.175916.7256@sq.com>, Mark Brader <msb@sq.com> wrote:
  12. :Wil Evers (wil@ittpub.nl) writes:
  13. ...
  14. :> For example, if I write:
  15. :>     #include <stdio.h>
  16. :>     struct c { char data; } carray[10];
  17. :>     int main() { printf("%u\n", sizeof carray); return 0; }
  18. :
  19. :... then on a word-addressed machine the output might very well be "40".  On
  20. :that machine, sizeof (struct c *) would probably be 4 while sizeof (char *)
  21. :would be 8, or maybe 6.
  22.  
  23. Or any machine could output "Segmentation fault... Core dumped"
  24. if size_t is not unsigned int.
  25.  
  26. Cheers,
  27. Stan.
  28. --
  29. Stan Ryckman  (stanr@tiac.net)
  30.   (Apologies for non-responses or late responses to some posts;
  31.   .newsrc was trashed and I'm trying to get it back to where it was.)
  32.